
import java.util.NoSuchElementException;
import java.util.Vector;

public class VectorQueue extends Vector {

    public VectorQueue() {
        super();
    }

    public VectorQueue(int inictialCapacity){
        super(inictialCapacity);
    }

    public VectorQueue(int initialCapacity,int capacityIncrement){
        super(initialCapacity, capacityIncrement);
    }

    public Object element(){
        return super.firstElement();
    }

    public Object remove(){
        Object aux = super.firstElement();
        super.removeElementAt(0);
        return aux;
    }

    public boolean offer(Object o){
        super.addElement(o);
        return true;
    }

    public Object poll(){
        Object aux;
        try{
        aux = super.firstElement();
        }catch(NoSuchElementException ex) {return null;}
        super.removeElementAt(0);
        return aux;
    }

    public Object peek(){
        try{
        return super.firstElement();
        }catch(NoSuchElementException ex) {return null;}
    }
}